import { Component, OnInit, Output, Input } from '@angular/core'
import { Subject } from 'rxjs'
import { EventEmitter } from 'events'

@Component({
  selector: 'app-rest-edit',
  templateUrl: './detail-rest-edit.component.html',
  styleUrls: ['./detail-rest-edit.component.less']
})
export class DetailRestEditComponent implements OnInit {
  @Input() editing: boolean

  @Output() edit = new Subject()
  @Output() cancel = new Subject()
  @Output() submit = new Subject()

  constructor() {}

  ngOnInit() {

  }

  handleEdit(): void {
    this.edit.next()
  }

  handleCancel(): void {
    this.cancel.next()
  }

  handleSubmit(): void {
    this.submit.next()
  }
}
